﻿using MediatR;
using S.EarTag.API.Application.MediatorCommand.BodyMeasureCommand;
using S.EarTag.Infrastructure.Repository.Interface.IEarTagRepository;

namespace S.EarTag.API.Application.MediatorCommandHandler.BodyMeasureCommandHandler
{
    public class BodyMeasureBatchRemoveCommandHandler : IRequestHandler<BodyMeasureBatchRemoveCommand, bool>
    {
        private readonly IBodyMeasureModelRepository _bodyMeasureModelRepository;
        public BodyMeasureBatchRemoveCommandHandler(IBodyMeasureModelRepository bodyMeasureModelRepository)
        {
            _bodyMeasureModelRepository= bodyMeasureModelRepository;
        }
        /// <summary>
        /// 批量删除体尺测量数据
        /// </summary>
        /// <param name="request"></param>
        /// <param name="cancellationToken"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public async Task<bool> Handle(BodyMeasureBatchRemoveCommand request, CancellationToken cancellationToken)
        {
            return await _bodyMeasureModelRepository.BatchBodyMeasure(request.ids);
        }
    }
}
